package com.java1223;

public class Java04 {
    //分支语句
    public static void main(String[] args) {
        //1.if()单分支
        if(true){
            System.out.println(8);
        }
        //2.if()else双分支，至少执行一个分支
        if(true){
            System.out.println(1);
        }else{
            System.out.println(2);
        }
        //3.多分支，至少执行一个分支
        if(true){
            System.out.println(1);
        }else if(true){
            System.out.println(2);
        }else{
            System.out.println(3);
        }
        //4.switch() (byte,short,int,char,string)
        int i=3;
        switch (i){
            case 1:
                System.out.println(1);
                break;
            case 2:
                System.out.println(2);
                break;
            case 3:
                System.out.println(3);
                break;
            default:
                System.out.println("default");
        }

    }
}
